﻿@model PH.Model.Systems.NoticeCollection
<div class="ph-tabs">
    <ul>
        <li class="k-state-active">通知</li>
        <li>系统更新日志</li>
    </ul>
    <div>
        @foreach (var notic in Model)
        {
            <div class="k-block" style="margin:10px">
                <div class="k-header" style="text-align:center">
                    <b style="font-size:20px;">@notic.Title</b>
                </div>
                <div style="line-height:30px; padding:0px 50px; color:#666">
                    @Html.Raw(notic.Description)
                </div>
            </div>
        }
    </div>
    <div>
        <div id="grid_logs" style="text-align: center"></div>
    </div>
</div>

<script class="init">
    $(function () {
        @if (Model.TotalRecordsCount == 0)
        {
            <text>$(".ph-tabs").data("kendoTabStrip").select(1);</text>
        }
    });
    
</script>

<script class="grid_logs_columns">
    var logsFields = [{
        title: "#",
        field: "ID",
        width: 50
    }, {
        title: "内容",
        field: "Description",
        attributes: { style: "text-align:left" },
        width: 800
    }, {
        title: "日期",
        field: "CreatedOn",
        template: "#=kendo.toString(kendo.parseDate(CreatedOn),'yyyy-MM-dd')#",
        width: 100
    }, {}];
</script>

<script class="grid_config">
    $(function () {
        $("#grid_logs").kendoGrid({
            columns: logsFields,
            dataSource: Whale.dataSource({
                url: "/Systems/SysLog/Gets",
                pageSize: 20
            }),
            pageable: {
                messages: {
                    empty: "暂无数据"
                }
            },
            dataBound: function (e) {
                //让表头居中
                $("th.k-header").attr("style", "text-align:center; font-weight:bold;");
            }
        });
    });
</script>
